<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
	<title>webslideshow.rule.title.add</title>
	<style TYPE="text/css">
		BODY {
			background: #ece9d8;
			padding: 10;
			overflow: hidden;
			font-size: 14px;
		}
		TABLE {
			font-size: 14px;
		}
    </style>

	<script src="util/BrowserDependent.js" language="jscript" type="text/jscript"></script>
	<script src="util/KeyboardHelper.js" language="jscript" type="text/jscript"></script>
	<script src="factory/ComponentsFactory.js" language="jscript" type="text/jscript"></script>
	<script src="factory/Factory.js" language="jscript" type="text/jscript"></script>
	<script src="Logger.js" language="jscript" type="text/jscript"></script>
	<script src="ResourceBundle.js" language="jscript" type="text/jscript"></script>
	<script src="Configuration.js" language="jscript" type="text/jscript"></script>
	<script src="util/BrowserDependent.js" language="jscript" type="text/jscript"></script>
	<script src="util/Util.js" language="jscript" type="text/jscript"></script>
	<script src="util/Prompt.js" language="jscript" type="text/jscript"></script>
	<script src="util/HTMLContentHelper.js" language="jscript" type="text/jscript"></script>
	<script src="WindowManager.js" language="jscript" type="text/jscript"></script>
	<script src="WebProfiles.js" language="jscript" type="text/jscript"></script>
	<script src="WebProfiles.impl.js" language="jscript" type="text/jscript"></script>
	<script src="Rule.js" language="jscript" type="text/jscript"></script>
	<script language="jscript" type="text/jscript">
		function makeMultiline()
		{
			var elementTemplate = document.getElementById("element_template");
			if (!elementTemplate || elementTemplate.tagName == "TEXTAREA")
				return;

			var value = elementTemplate.value;
			var parentNode = elementTemplate.parentNode;
			parentNode.removeChild(elementTemplate);

			elementTemplate = document.createElement("TEXTAREA");
			elementTemplate.id = "element_template";
			elementTemplate.rows = 8;
			elementTemplate.style.width = "100%";
			elementTemplate.style.height = "100%";
			elementTemplate.setAttribute("value", value);
			window.dialogHeight = "350px";
			parentNode.appendChild(elementTemplate);
			parentNode.style.height = "100%";
		}
	</script>
	<script language="jscript" type="text/jscript">
		window.arguments = window.dialogArguments;
		function onPageLoad()
		{
			onLoad();

			var selected_id = "tag_" + document.getElementById("element_tag").value;
			var selected_elem = document.getElementById(selected_id.toLowerCase());
			if (selected_elem) selected_elem.checked = true;

			var btCancel = document.getElementById("button-cancel");
			var btOK = document.getElementById("button-ok");
			if (btOK && btCancel && btCancel.clientWidth)
			    btOK.style.width = btCancel.clientWidth + "px";

			try
			{
				var windowManager = yrprxComponentsFactory.createWindowManager();
				windowManager.clearDialogTitle(window);
				windowManager.setDialogStatus(window, document.title);
			}
			catch(e) {}
		}
		function onButtonOK()
		{
			var radioGroup = document.getElementsByName("element_tag");
			for (var i = 0; i < radioGroup.length; ++i)
			{
				if (!radioGroup[i].checked)
					continue;

				var element_tag = document.getElementById("element_tag");
				element_tag.value = radioGroup[i].value;
				element_tag.selectedItem = radioGroup[i];
				break;
			}
			if (onOK())
				close();
		}
		try
		{
			if (window.arguments.length == 2)
			{
				var ev = window.arguments[1];
				wsshWindowManager.getManager().StopKey(window, ev.keyCode, ev.shiftKey, ev.ctrlKey, ev.altKey);
			}
		}
		catch(e) {}
	</script>
</head>
<body id="wsshRuleDlg" edit_title="webslideshow.rule.title.edit" onload="onPageLoad();">
	<table style="width:100%;height:100%;">
		<tr>
			<td><nobr>webslideshow.rule.domain</nobr></td>
			<td style="width:100%;"><input id="domain" style="width:100%" message_on_empty="webslideshow.rule.enter.domain"/></td>
		</tr>
		<tr>
			<td><nobr>webslideshow.rule.page.pattern</nobr></td>
			<td><input id="page_pattern" style="width:100%"/></td>
		</tr>
		<tr>
			<td><nobr>webslideshow.rule.element</nobr></td>
			<td>
				<div id="element_tag">
					<input type="radio" name="element_tag" id="tag_img"  value="IMG" checked/>webslideshow.rule.element.img
					<input type="radio" name="element_tag" id="tag_a"    value="A"/>webslideshow.rule.element.a
					<input type="radio" name="element_tag" id="tag_area" value="AREA"/>webslideshow.rule.element.area
				</div>
			</td>
		</tr>
		<tr>
			<td><nobr>webslideshow.rule.element.pattern</nobr></td>
			<td><input id="element_pattern" style="width:100%" message_on_empty="webslideshow.rule.enter.element.pattern"/></td>
		</tr>
		<tr>
			<td><nobr>webslideshow.rule.element.template</nobr></td>
			<td><input id="element_template" style="width:100%"/></td>
		</tr>
		<tr>
			<td colspan="2" align="right">
				<input id="button-ok"     type="button" value="webslideshow.rule.button.ok"     onclick="onButtonOK();">
				<input id="button-cancel" type="button" value="webslideshow.rule.button.cancel" onclick="window.close();">
			</td>
		</tr>
	</table>
</body>
</html>